# -*- coding:utf-8 -*-
#Python
#Generator: PyCharm
#Author: Zhong

from django.contrib import admin
from emp import models

class MetaEmp(admin.ModelAdmin):
    class Meta:
        app_label = u'员工管理模块'


class EmployeeAdmin(admin.ModelAdmin):
    list_display = ('name', 'post')
    list_filter = ('department',)

    
    #filter_horizontal = ('department',)
    #filter_vertical = ('department',)
    #raw_id_fields = ('department',)
    search_fields = ('name', 'post')

class DepartmentAdmin(admin.ModelAdmin):
    list_display = ('name', 'desc')
    list_filter = ('category',)
    search_fields = ('name', 'desc')

    admin.site.register(models.Category)
admin.site.register(models.Department, DepartmentAdmin)
admin.site.register(models.Employee, EmployeeAdmin)